package org.example.ioc.pro5_ipc_import;

import org.example.ioc.pro5_ipc_import.other.Apple;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AppConfig_1_Test {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig_1.class);
        //获取容器中所有的bean定义
        String[] names = context.getBeanDefinitionNames();
        for (String name : names) {
            System.out.println(name);
        }
        Apple a = (Apple) context.getBean("org.example.ioc.pro5_ipc_import.other.Apple");
        System.out.println(a);
    }

}
